<div class="main-content">
    <div class="container">
        <div class="row">
            <div class="col-sm-12">
                <ol class="breadcrumb">
                    <li>
                        <i class="clip-file"></i>
                        <a href="#">
                            Logística
                        </a>
                    </li>
                    <li class="active">
                        Productos
                    </li>					
                </ol>
                <div class="page-header">
                    <h1>Productos <small>Búsqueda Avanzada</small></h1>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-8">
                <!-- start: DYNAMIC TABLE PANEL -->
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <i class="icon-external-link-sign"></i>
                        Productos
                        <div class="panel-tools">
                            <a class="btn btn-xs btn-link panel-collapse collapses" href="#">
                            </a>
                            <a class="btn btn-xs btn-link panel-config" href="#panel-config" data-toggle="modal">
                                <i class="icon-wrench"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-refresh" href="#">
                                <i class="icon-refresh"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-expand" href="#">
                                <i class="icon-resize-full"></i>
                            </a>
                            <!--<a class="btn btn-xs btn-link panel-close" href="#">
                                <i class="icon-remove"></i>
                            </a> -->
                        </div>
                    </div>
                    <div class="panel-body">
                        <form action="<?php echo base_url('logistica/proceso/detProducto'); ?>" method="POST">
                            <div class="row">
                                <div class="col-md-5">
                                    <div class="form-group">
                                        <label for="linea">Línea</label>
                                        <!--<select id="linea" name="linea" class="form-control search-select">
                                            <option></option>                                       
                                        </select> -->
                                        <?php
                                        $atributos = 'class="form-control search-select" id="linea" placeholder="Seleccione Linea"';
                                        echo form_dropdown("linea", $lineas, $this->form_data->linea, $atributos);
                                        ?>
                                    </div>
                                </div>
                                <div class="col-md-5">
                                    <div class="form-group">
                                        <label for="familia">Familia</label>
                                        <!--<select id="familia" name="familia" class="form-control search-select">
                                            <option></option>
                                        </select> -->
                                        <?php
                                        $prop = 'class="form-control search-select" id="familia" placeholder="Seleccione Familia"';
                                        echo form_dropdown("familia", $familias, $this->form_data->familia, $prop);
                                        ?>
                                    </div>
                                </div>
                                <div class="col-md-1">
                                    <br/>
                                    <div class="space7"></div>
                                    <div class="form-group">                                    
                                        <button type="submit" id="busProd" class="btn btn-primary"><i class="icon-search"></i></button>
                                    </div>  
                                </div>
                            </div>
                        </form>
                        <hr>

                        <table class="table table-striped table-bordered table-condensed table-hover table-full-width" id="sample_1">
                            <thead>
                                <tr>
                                    <th class="hidden">Id</th>
                                    <!--<th>Código</th> -->
                                    <th>Producto</th>
                                    <th>Modelo</th>
                                    <th>Stock</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php
                                if (!empty($productos)) :
                                    foreach ($productos as $fila):
                                        ?>
                                        <tr class="desmarcado" style="cursor: pointer;" 
                                            onclick="referenciasProd('<?php echo base_url('logistica/proceso'); ?>', '<?php echo $fila->id_prod; ?>');" >               
                                            <td class="hidden"><?php echo $fila->id_prod; ?></td>
                                            <!--<td><?php echo $fila->cod_prod; ?></td>-->
                                            <td><?php echo $fila->desc_prod; ?></td>  
                                            <td><?php echo $fila->modelo; ?></td>
                                            <td><?php echo $fila->stock; ?></td>
                                        </tr>
                                        <?php
                                    endforeach;
                                endif;
                                ?>       					
                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- end: DYNAMIC TABLE PANEL -->
            </div>
            <div class="col-sm-4">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <i class="icon-external-link-sign"></i>
                        Precios
                        <div class="panel-tools">
                            <a class="btn btn-xs btn-link panel-collapse collapses" href="#">
                            </a>
                            <a class="btn btn-xs btn-link panel-config" href="#panel-config" data-toggle="modal">
                                <i class="icon-wrench"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-refresh" href="#">
                                <i class="icon-refresh"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-expand" href="#">
                                <i class="icon-resize-full"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-close" href="#">
                                <i class="icon-remove"></i>
                            </a>
                        </div>
                    </div>
                    <div class="panel-body">
                        <table class="table table-striped table-bordered table-condensed table-hover table-full-width" id="tblPrecProdxSuc">
                            <thead>
                                <tr>
                                    <th class="hidden">Id</th>
                                    <th>Tipo</th>
                                    <th>Cant</th>
                                    <th>Precio</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>Venta</td>
                                    <td>0</td>
                                    <td>0.00</td>
                                </tr>
                                <tr>
                                    <td>Mayorista</td>
                                    <td>0</td>
                                    <td>0.00</td>
                                </tr>
                                <tr>
                                    <td>Oferta</td>
                                    <td>0</td>
                                    <td>0.00</td>
                                </tr>
                                <tr>
                                    <td>Compra</td>
                                    <td>0</td>
                                    <td>0.00</td>
                                </tr>    
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <i class="icon-external-link-sign"></i>
                        Stock por Sucursales
                        <div class="panel-tools">
                            <a class="btn btn-xs btn-link panel-collapse collapses" href="#">
                            </a>
                            <a class="btn btn-xs btn-link panel-config" href="#panel-config" data-toggle="modal">
                                <i class="icon-wrench"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-refresh" href="#">
                                <i class="icon-refresh"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-expand" href="#">
                                <i class="icon-resize-full"></i>
                            </a>
                            <a class="btn btn-xs btn-link panel-close" href="#">
                                <i class="icon-remove"></i>
                            </a>
                        </div>
                    </div>
                    <div class="panel-body">
                        <table class="table table-striped table-bordered table-condensed table-hover" id="tblStkSucursal">
                            <thead>
                                <tr>
                                    <th>Sucursal</th>												
                                    <th>Stock</th>												
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td>Cajamarca</td>
                                    <td class="hidden-xs">0</td>
                                </tr>
                                <tr>
                                    <td>Chiclayo</td>
                                    <td class="hidden-xs">0</td>
                                </tr>
                                <tr>
                                    <td>Jaén</td>
                                    <td class="hidden-xs">0</td>												
                                </tr>
                                <tr>
                                    <td>Piura</td>
                                    <td class="hidden-xs">0</td>												
                                </tr>    
                                <tr>
                                    <td>Trujillo</td>
                                    <td class="hidden-xs">0</td>												
                                </tr>    
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <!-- end: PAGE CONTENT-->
    </div>

    <!---- Ventana edición ----->


    <!-- end: Ventana edición-->

</div>

<script type="text/javascript">
                                                $(function() {
                                                    $("#linea").change(function() {
                                                        $("#familia option").remove();
                                                        var linea = $("#linea").val();
                                                        if (linea > 0) {
                                                            combo("<?php echo base_url("logistica/proceso/combo/familia") ?>/" + linea, "familia");
                                                        }
                                                    });
                                                });

</script>
